package com.hnas.mrch.service.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.hnas.core.mapper.Mapper;
import com.hnas.mrch.orm.GenerateMrchTwoCode;
import com.hnas.mrch.service.dto.DTOGenerateMrchTwoCode;

public class GenerateMrchTwoCodeMapper extends Mapper<DTOGenerateMrchTwoCode, GenerateMrchTwoCode> {

	private static GenerateMrchTwoCodeMapper generateMrchTwoCodeMapper;

	private GenerateMrchTwoCodeMapper() {
		super(DTOGenerateMrchTwoCode.class, GenerateMrchTwoCode.class);
	}

	public static GenerateMrchTwoCodeMapper getInstance() {
		if (generateMrchTwoCodeMapper == null) {
			generateMrchTwoCodeMapper = new GenerateMrchTwoCodeMapper();
		}
		return generateMrchTwoCodeMapper;
	}

	public DTOGenerateMrchTwoCode mapToValue(GenerateMrchTwoCode vo) {
		DTOGenerateMrchTwoCode dto = new DTOGenerateMrchTwoCode();
		BeanUtils.copyProperties(vo, dto);
		return dto;
	}

	public List<DTOGenerateMrchTwoCode> mapToValue(List<GenerateMrchTwoCode> vo) {
		List<DTOGenerateMrchTwoCode> list = new ArrayList<DTOGenerateMrchTwoCode>();
		for (GenerateMrchTwoCode gm : vo) {
			DTOGenerateMrchTwoCode dto = this.mapToValue(gm);
			list.add(dto);
		}
		return list;
	}
}
